﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class MainPanel : MonoBehaviour
{
    private Button btn_Satrt;

    // Start is called before the first frame update
    void Awake()
    {
        Init();
    }

    /// <summary>
    /// 初始化
    /// </summary>
    private void Init()
    {
        btn_Satrt = transform.Find("btn_Start").GetComponent<Button>();
        Debug.Log(btn_Satrt);
        btn_Satrt.onClick.AddListener(OnStartButtonClick);
    }

    /// <summary>
    /// 开始按钮点击
    /// </summary>
    private void OnStartButtonClick()
    {
        gameObject.SetActive(false);
        EventCenter.Broadcast(EventDefine.ShowGamePanel);
        GameManager.Instance.IsGameStarted = true;
        GameManager.Instance.IsGameOver = false;
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
